<template>
	<view class="product">
	    <view class="proitem" v-for="(item,index) in dataProduct" :key="index" @tap="goinfo(item.id)">
            <image :src="item.img"></image>
            <view>{{item.des}}</view> 
            <view>{{item.name}}</view>
            <view>
                <text>￥{{item.price}}</text>
                <text class="oldp">{{item.oldPrice?"￥"+item.oldPrice:""}}</text>
            </view>   
        </view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				
			}
		},
        props:["dataProduct"],
		onLoad() {

		},
		methods: {
            goinfo(myid){
                //路由是 小程序的路由，跳转也要用小程序的方式
                uni.navigateTo({
                    url: '/pages/info/info?id='+myid
                });
            }
		}
	}
</script>

<style>
	.product{
        display: flex;
        justify-content: space-around;
        flex-wrap: wrap;
    }
    .proitem{
       width:42%;
    }
    .proitem image{
        width:100%;
    }
    .oldp{
        text-decoration:line-through;
    }
</style>